#include "ConditionVariable.h"

ConditionVariable::ConditionVariable()
{
	pthread_cond_init (&cv, NULL);
}

void ConditionVariable::signal()
{
	pthread_cond_signal(&cv);
}

void ConditionVariable::broadcast()
{
	pthread_cond_broadcast(&cv);
}

void ConditionVariable::wait(Mutex& mutex)
{
	pthread_cond_wait(&cv, &mutex.m);
}

ConditionVariable::~ConditionVariable()
{
	pthread_cond_destroy(&cv);
}


